import BuffUtil from '@/BuffUtil';
import SelectUtil from '@/SelectUtil';
import UnitSpellEvent from '@/event/UnitSpellEvent';
import SelectCommon from 'code/Core/Common/SelectCommon';
export default class Item_坚韧之鼓 {
    static id = 'AIsa';
    static 名称: string = '坚韧之鼓';
    static 描述: string = '该单位受到坚韧之鼓的影响，增加了攻速和移速';
    static 图标: string = 'ReplaceableTextures\\CommandButtons\\BTNJanggo.blp';
    static buffId: string = 'buff_item_jianggo';
    static buffType: AppBuffType = {
        id: 'buff_item_jianggo',
        ubertip: Item_坚韧之鼓.描述,
        name: Item_坚韧之鼓.名称,
        art: Item_坚韧之鼓.图标,
        dur: 8,
        attribute: {
            attackSpd_p: 0.45,
            move_speed_p: 0.15,
        },
        targetAttach: 'overhead',
        targetArt: 'Abilities\\Spells\\Items\\AIsp\\SpeedTarget.mdl',
    };
    static 添加技能(目标: unit) {
        UnitAddAbility(目标, Item_坚韧之鼓.id);
    }
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {
        let us = SelectCommon.getAllyUnitInRange(来源, 1000);
        for (let u of us) {
            BuffUtil.addBuff(u, Item_坚韧之鼓.buffId, 来源);
        }
    }
    constructor() {
        BuffUtil.registerBuffType(Item_坚韧之鼓.buffType);
        se.onUnitSpellEffect(Item_坚韧之鼓.spellEffect, Item_坚韧之鼓.id);
    }
    static spellEffect(this: void, d: UnitSpellEvent) {
        Item_坚韧之鼓.释放(d.spellTargetX, d.spellTargetY, d.trigUnit, d.spellTargetUnit, d);
    }
}
